﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.IO;

namespace Milo.Builder
{
    class Program
    {
        static void Main(string[] args)
        {
            Program prog = new Program();

            prog.Run(args);
        }

        public void Run(string[] args)
        {
            try
            {
                if (args.Length < 2)
                    throw new ArgsException();

                CodeGen cg = new CodeGen();

                for (int i = 0, c = args.Length - 1; i < c; i++)
                {
                    string dll = args[i];

                    cg.AddDllFilename(dll);
                }

                string file = args.Last();

                using (StreamWriter writer = File.CreateText(file))
                {
                    cg.GenerateSource(writer);
                }
            }
            catch (ArgsException)
            {
                DisplayHelp();
            }
        }

        private void DisplayHelp()
        {
            throw new NotImplementedException();
        }
    }
}
